package org.megha.blog.example.morethreads;

public class Main {

	public static void main(String args[]) throws InterruptedException {

		Thread threadX1 = new Thread(new TimeReporter(100, 10000));
		threadX1.start();
		Thread threadX2 = new Thread(new TimeReporter(100, 10000));
		threadX2.start();

		Thread threadY = new Thread(new TimeReporter(200, 10000));
		threadY.start();

		threadX1.join();
		threadX2.join();
		threadY.join();

		int timesCalled = StatisticsCollector.STATS.getTimesCalled();
		double average = StatisticsCollector.STATS.getAverage();

		System.out.println("Total Calls: " + (timesCalled));
		System.out.println("Average Time: " + (average));
	}
}
